﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2023_09_13
{
    internal class NumberOfStairs
    {
        public static int CountWays(int step)
        {
            if (step < 0) return 0;
            if (step == 0) return 1;
            if (step == 1) return 0;

            return CountWays(step-2) + CountWays(step-3);
        }
        static void Main2(string[] args)
        {
            int t= int.Parse(Console.ReadLine());
            for (int i = 0; i < t; i++)
            {
                int n = int.Parse(Console.ReadLine());
                Console.WriteLine(CountWays(n));
            }
        }
    }
}
